//
//  UINavigationController+CMPush.m
//  QMBusApp_swift
//
//  Created by Massimo on 16/5/17.
//  Copyright © 2016年 Zjevil. All rights reserved.
//

#import "UINavigationController+CMPush.h"
#import "ObjcRuntime.h"
@implementation UINavigationController (CMPush)
+ (void)load{
  Swizzle([self class], @selector(pushViewController:animated:) ,@selector(swizzlePushViewController:animated:));
  Swizzle([self class], @selector(popViewControllerAnimated:) ,@selector(swizzlePopViewControllerAnimated:));
}
- (void)viewWillAppear:(BOOL)animated{
  [super viewWillAppear:animated];
  
}
- (void)swizzlePopViewControllerAnimated:(BOOL)animated{
  
  
  [self swizzlePopViewControllerAnimated:animated];
}


- (void)swizzlePushViewController:(UIViewController*)viewController animated:(BOOL)animated{
    self.navigationBar.backItem.title = @"";
  
  [self swizzlePushViewController:viewController animated:animated];
}


- (void)onClickBack{
  [self popViewControllerAnimated:YES];
}


- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{
  
  return self.childViewControllers.count > 1;
}


@end
